﻿using System;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data;
using System.Data.SqlClient;

[WebService(Namespace = "http://tempuri.org/", Description = "<B>CarDetailsWebService</B>")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
    public Service () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public DataSet CarDetails(string model)
    {
        string strConn = "Data source = ThoPN; Initial Catalog= LuxuryDrive; uid = sa; pwd= 123456";
        SqlConnection conn = new SqlConnection(strConn);
        SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM CarDetails WHERE ModelNo = '" + model + "'",conn);
        DataSet ds = new DataSet( "dsLuxuryDrive");
        da.Fill(ds, "CarDetails");
        return ds;
    }

    
}
